Mac Yosemite系统 brew 报错的解决办法

今天学习React Native时,发现需要使用homebrew 安装watchman,不顺利的事情又一次发生了,运行
brew install watchman 提示错误:

/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory/usr/local/bin/brew: line 23: /usr/local/Library/brew.rb: Undefined error: 0
检查发现Ruby版本不对,最后google了很多资料研究了,发现下面的解决办法是比较好的:

1
2
3
cd /System/Library/Frameworks/Ruby.framework/Versions
sudo ln -s Current 1.8
brew update
Contents
,